def is_clean(w: str) -> bool:
    for i in range(len(w)):
        if w[i] in w[:i] + w[i+1:]:
            return False
    return True


words = open('dict.txt', 'r').readlines()
for idx in range(len(words)):
    words[idx] = words[idx][:-1]
write_pointer = open('dict/dict.clean.txt', 'w')


if __name__ == '__main__':
    for word in words:
        if is_clean(word):
            write_pointer.write(word + '\n')

write_pointer.close()
